#pragma once
#include "PDTExp.h"
#include "PDTVar.h"

class PDTSetVar  :  public PDTExpSet, public PDTVar, public TraverseIfc <PDTSetVar , PDTNode> { 
    public:  TRAVERSAL_IFC_IMPL(PDTSetVar )
public:
	PDTSet * set;
	PDTSetVar (PDTCodeGraph & CG, PDTSet & aSet, string name) :
		PDTExpSet(CG), PDTVar(name), set(&aSet)	{
		//CG.addVar(this);
		set->addChild(this);
		addParent(set);
	}

	PDTSet * getSet() const {return set;}
	void setSet(PDTSet & aSet) {set=&aSet;}

	NodeTypeEnum getType(){return PDTSetVar_Em;}
	virtual bool isSetVar(){return true;}
	virtual bool isVar(){return true;}
	virtual PDTNode* getNode()  {return this;}
	virtual ~PDTSetVar(){}
	virtual stringstream & toString(stringstream & ss) const {
		ss << getName();
		return ss;
	}
};
